<?php

class Bill_Model extends CI_Model {

    function __construct() 
    {
           parent::__construct();
    }
       
    function getAllBillsByUserId($userId)
    {        
        $query ="SELECT FAC_ID,FAC_FECHAFACTURACION FROM  FACTURA LEFT JOIN USUARIOMATRICULACONEXION ON FACTURA.MAT_ID=USUARIOMATRICULACONEXION.MAT_ID WHERE USUARIOMATRICULACONEXION.USUA_ID=".$userId;
        $results = $this->db->query($query)->result();
        return $results;
    }
    
    function generateServicesLiquidation($userId)
    {        
        $query ="SELECT FAC_ID,FAC_FECHAFACTURACION FROM  FACTURA LEFT JOIN USUARIOMATRICULACONEXION ON FACTURA.MAT_ID=USUARIOMATRICULACONEXION.MAT_ID WHERE USUARIOMATRICULACONEXION.USUA_ID=".$userId;
        $results = $this->db->query($query)->result();
        return $results;
    }
}
?>
